<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Trail - {% block title %}{% endblock %}</title>
    <link rel="shortcut icon" href="/images/favicon.png" />
    {% block head_link %}{% endblock %}
    <!-- Bootstrap -->
    <link href="{{ STATIC_URL }}css/bootstrap.min.css" rel="stylesheet">
    {% block styles %}{% endblock %}
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="{{ STATIC_URL }}js/bootstrap.min.js"></script>
    {% block scripts %}{% endblock %}
  </head>
  <body>
    <header class="navbar navbar-static-top  navbar-default" id="top" role="banner">
      <div class="container">
        <nav class="navbar" role="navigation">
          <div class="container-fluid">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
              <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
              </button>
              <a class="navbar-brand" href="#">Trail</a>
            </div>

            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
              <ul class="nav navbar-nav">
                <li class="active"><a href="{% url "index" %}">首页</a></li>
                <li><a href="{% url "home" %}">个人中心</a></li>
                <li><a href="{% url "category-list" %}">类别</a></li>
              </ul>
              <ul class="nav navbar-nav navbar-right">
                <li class="dropdown">
                  <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                    账号 <span class="caret"></span>
                  </a>
                  <ul class="dropdown-menu" role="menu">
                    {% if user.is_authenticated %}
                      <li><a href="{% url "signout" %}">登出</a></li>
                      <li class="divider"></li>
                      <li><a href="{% url "setting" user.username %}">设置</a></li>
                    {% else %}
                      <li><a href="{% url "signin" %}">登入</a></li>
                      <li><a href="{% url "signup" %}">注册</a></li>
                    {% endif %}


                  </ul>
                  </li>
              </ul>
            </div><!-- /.navbar-collapse -->
          </div><!-- /.container-fluid -->
        </nav>

      </div>
    </header>
    <div class="container">
      {% if messages %}
        {% for message in messages %}
        <div class="alert alert-{{ message.tags }} alert-dismissible" role="alert">
          <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
            <strong>{{ message }}</strong>
        </div>
        {% endfor %}
      {% endif %}
      {% block navpath %}{% endblock %}
      {% block doublemain %}{% endblock %}
      {% block sinlgemain %}{% endblock %}
    </div>
    <footer role="contentinfo">
      <div class="container">
        <div>
          <p>Design By <a href="#">rsj217</a></p>
          <p>Code licensed under <a href="https://github.com/twbs/bootstrap/blob/master/LICENSE" target="_blank">MIT</a></p>
        </div>
      </div>
    </footer>
  </body>
</html>